home *** CD-ROM | disk | FTP | other *** search
/ Czech Logic, Card & Gambling Games / Logické hry.iso / hry / Fish Fillets / script / briefcase / demo_briefcase.lua < prev    next >
Text File  |  2005-07-16  |  4KB  |  253 lines

  1.  
  2. codename = "briefcase"
  3. file_include("script/share/level_dialog.lua")
  4. dialogLoad("script/"..codename.."/brief_")
  5.  
  6. local function planDelay(delay)
  7.     if delay > 0 then
  8.         game_planAction(function(count)
  9.             --NOTE: count starts from 0
  10.             return count >= delay - 1
  11.         end)
  12.     end
  13. end
  14.  
  15. local picture_counter = 0
  16. local function nextPicture()
  17.     game_planAction(function(count)
  18.         local number = picture_counter
  19.         if picture_counter < 100 then
  20.             number = "0"..number
  21.             if picture_counter < 10 then
  22.                 number = "0"..number
  23.             end
  24.         end
  25.         demo_display("images/demo_briefcase/demo_"..number..".png", 135, 25)
  26.         picture_counter = picture_counter + 1
  27.         return true
  28.     end)
  29. end
  30.  
  31. local actor_index = 1
  32. local function talk(dialog_name)
  33.     game_planAction(function(count)
  34.         model_talk(actor_index, dialog_name)
  35.         return true
  36.     end)
  37. end
  38. local function waitForTalker(dialog_name)
  39.     game_planAction(function(count)
  40.         return not model_isTalking(actor_index)
  41.     end)
  42. end
  43.  
  44. local function planAnim(count)
  45.     for i = 1, count do
  46.         nextPicture()
  47.     end
  48. end
  49.  
  50.  
  51. -- -----------------------------------------------------------------
  52. -- start
  53. game_planAction(function(count)
  54.     sound_playMusic("music/kufrik.ogg")
  55.     demo_display("images/demo_briefcase/kufr256.png", 0, 0)
  56.     return true
  57. end)
  58.  
  59. planDelay(7)
  60. -- rotating logo
  61. nextPicture()
  62. planDelay(1)
  63. planAnim(3)
  64.  
  65. talk("kd-uvod")
  66. planAnim(48)
  67. planDelay(9)
  68. nextPicture()
  69. planDelay(2)
  70. nextPicture()
  71. planDelay(2)
  72. nextPicture()
  73. planDelay(2)
  74. nextPicture()
  75. planDelay(8)
  76. waitForTalker()
  77.  
  78. talk("kd-ufo")
  79. planDelay(6)
  80. -- a bird
  81. nextPicture()
  82. planDelay(12)
  83. nextPicture()
  84. planDelay(12)
  85. nextPicture()
  86. planDelay(12)
  87. nextPicture()
  88. planDelay(12)
  89. nextPicture()
  90. planDelay(12)
  91. nextPicture()
  92. planDelay(13)
  93. -- the map
  94. nextPicture()
  95. planDelay(23)
  96. -- planets
  97. planAnim(9) 
  98. planDelay(3)
  99. -- triangle
  100. nextPicture()
  101. nextPicture()
  102. planDelay(2)
  103. -- circle
  104. nextPicture()
  105. planDelay(1)
  106. nextPicture()
  107. planDelay(1)
  108. -- hatch
  109. nextPicture()
  110. planDelay(1)
  111. nextPicture()
  112. planDelay(2)
  113. -- conformity
  114. planAnim(4)
  115. -- E=mc^2
  116. nextPicture()
  117. planDelay(3)
  118. nextPicture()
  119. planDelay(1)
  120. nextPicture()
  121. planDelay(1)
  122. -- square root
  123. nextPicture()
  124. planDelay(1)
  125. -- angle
  126. nextPicture()
  127. -- buy list
  128. nextPicture()
  129. planDelay(1)
  130. nextPicture()
  131. planDelay(2)
  132. -- equation
  133. planAnim(5)
  134. planDelay(2)
  135. -- strike
  136. nextPicture()
  137. waitForTalker()
  138.  
  139. talk("kd-mesto")
  140. planDelay(14)
  141. -- table
  142. nextPicture()
  143. planDelay(31)
  144. -- city
  145. nextPicture()
  146. planDelay(23)
  147. planAnim(28)
  148. -- map
  149. nextPicture()
  150. waitForTalker()
  151.  
  152. talk("kd-bermudy")
  153. planDelay(4)
  154. nextPicture()
  155. planDelay(31)
  156. planAnim(43)
  157. waitForTalker()
  158.  
  159. talk("kd-silver")
  160. planDelay(9)
  161. -- ship
  162. nextPicture()
  163. planDelay(14)
  164. nextPicture()
  165. planDelay(2)
  166. -- nothing
  167. nextPicture()
  168. planDelay(13)
  169. -- Silver
  170. nextPicture()
  171. planDelay(11)
  172. -- animals
  173. nextPicture()
  174. planDelay(8)
  175. nextPicture()
  176. planDelay(8)
  177. nextPicture()
  178. planDelay(7)
  179. nextPicture()
  180. planDelay(7)
  181. nextPicture()
  182. planDelay(6)
  183. nextPicture()
  184. planDelay(6)
  185. nextPicture()
  186. planDelay(5)
  187. nextPicture()
  188. planDelay(5)
  189. nextPicture()
  190. planDelay(5)
  191. nextPicture()
  192. planDelay(3)
  193. nextPicture()
  194. planDelay(2)
  195. nextPicture()
  196. waitForTalker()
  197.  
  198. talk("kd-pocitac")
  199. planDelay(14)
  200. nextPicture()
  201. planDelay(4)
  202. planAnim(6)
  203. planDelay(15)
  204. nextPicture()
  205. planDelay(1)
  206. nextPicture()
  207. planDelay(1)
  208. nextPicture()
  209. planDelay(1)
  210. nextPicture()
  211. planDelay(28)
  212. nextPicture()
  213. planDelay(17)
  214. planAnim(11)
  215. waitForTalker()
  216.  
  217. talk("kd-zelva")
  218. planDelay(2)
  219. planAnim(12)
  220. planDelay(9)
  221. nextPicture()
  222. planDelay(25)
  223. nextPicture()
  224. planDelay(25)
  225. planAnim(24)
  226. waitForTalker()
  227.  
  228. talk("kd-elektr")
  229. planDelay(6)
  230. nextPicture()
  231. planDelay(19)
  232. planAnim(10)
  233. planDelay(10)
  234. nextPicture()
  235. planDelay(14)
  236. waitForTalker()
  237.  
  238. talk("kd-gral")
  239. planAnim(21)
  240. waitForTalker()
  241.  
  242. talk("kd-zaver")
  243. planDelay(3)
  244. planAnim(11)
  245. planDelay(26)
  246. nextPicture()
  247. planDelay(34)
  248. nextPicture()
  249. waitForTalker()
  250.  
  251. talk("kd-znici")
  252. planDelay(27)
  253.